<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>定制商品</h2>
    </div>
    <div class="form-item">
            <label class="item-label">统一价格</label>
            <div class="controls">
                <input type="text" class="price" name="price[]" value="" placeholder="输入统一价格">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">统一库存</label>
            <div class="controls">
                <input type="text" class="num" name="num[]" value="" placeholder="输入统一库存量">
            </div>
        </div>
    <form action="{:U('attrprice')}" method="post" class="form-horizontal" enctype="multipart/form-data">
   
    
        <input type="hidden" class="text" name="gid" value="{$gid}">
        <foreach name="res" item="v">
        <div class="form-item">
         <div class="form-item">
            <label class="item-label">属性：{$v}</label>
            <div class="controls">
             <input type="hidden" class="text" name="attrvid_name[]" value="{$v}">
              
                <input type="hidden" class="text" name="attrvid[]" value="{$vid[$key]}">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">商品价格</label>
            <div class="controls">
                <input type="text" class="price_erzi" name="price[]" value="" placeholder="输入商品价格">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">库存</label>
            <div class="controls">
                <input type="text" class="num_erzi" name="num[]" value="" placeholder="输入库存量">
            </div>
        </div>
        <hr>
        </foreach>
        <div class="form-item">
    <button class="btn submit-btn" id="submit" type="submit" target-form="form-horizontal">确 定</button>
     <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>
<block name='script'>
<script src="https://cdn.bootcss.com/jquery/2.2.2/jquery.min.js"></script>
  <script>
      $('.price').keyup(function(){
         $('.price_erzi').val($(this).val());
      })
       $('.num').keyup(function(){
         $('.num_erzi').val($(this).val());
      })
  </script>
  </block>